<div class="models index">
<h2><?php echo $page_heading?></h2>
<p>
<?php
echo $paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<?php
$urlArgs = array('url'=>array($type));
?>
<table cellpadding="0" cellspacing="0">
<tr>
	<th><?php echo $paginator->sort('id');?></th>
	<th><?php echo $paginator->sort('user_id');?></th>
	<th><?php echo $paginator->sort('title');?></th>
	<th><?php echo $paginator->sort('email');?></th>
	<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($comments as $comment):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $comment['Comment']['id']; ?>
		</td>
		<td>
			<?php
				if(!$comment['User']['display_name'])
					echo $comment['User']['first_name']; 	
				else
					echo $comment['User']['display_name']; 
			?>
		</td>
		<td>
			<?php echo $comment['Comment']['title']; ?>
		</td>
		<td>
			<?php echo $comment['User']['email']; ?>
		</td>
		
		<td class="actions">
			<?php echo $userContent->showLink($comment['Comment']['id'], $comment['Comment']['status']); ?>
			<?php echo $html->link(__('View', true), array('action'=>'view', $comment['Comment']['id'])); ?>
			<?php echo $html->link(__('Delete', true), array('action'=>'delete/', $type.'_'.$comment['Comment']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $comment['Comment']['id'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
	<?php echo $paginator->prev('<< '.__('previous', true), array($urlArgs), null, array('class'=>'disabled'));?>
 | 	<?php echo $paginator->numbers($urlArgs);?>
	<?php echo $paginator->next(__('next', true).' >>', array($urlArgs), null, array('class'=>'disabled'));?>
</div>

<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Pending '.$type.' Comments', true), array('action'=>'moderate/'.$type));?></li>
		<li><?php echo $html->link(__('Spam '.$type.' Comments', true), array('action'=>'moderate/'.$type.'/spam'));?></li>
	
	</ul>
</div>
